import {createRouter, createWebHashHistory} from "vue-router";

const router = createRouter({
    history: createWebHashHistory(),
    scrollBehavior(): { top: number, left: number } {
        return {
            left: 0,
            top: 0
        }
    },
    routes: [
        {
            path: '/',
            redirect: '/home'
        },
        {
            path: '/home',
            component: () => import('../views/home/home.vue')
        },
        {
            path: '/member',
            name: "member",
            redirect: "/member/cert",
            component: () => import('../views/member/member.vue'),
            children: [
                {
                    path: "cert",
                    component: () => import('../views/member/views/cert/cert.vue')
                },
                {
                    path: "order",
                    component: () => import('../views/member/views/order/order.vue')
                },
                {
                    path: "patient",
                    component: () => import('../views/member/views/patient/patient.vue')
                },
                {
                    path: "message",
                    component: () => import('../views/member/views/message/message.vue')
                },
                {
                    path: "feedback",
                    component: () => import('../views/member/views/feedback/feedback.vue')

                }
            ]
        },
        {
            path: '/hospital',
            name: 'hospital',
            redirect: '/hospital/register',
            component: () => import('../views/hospital/hospital.vue'),
            children: [
                {
                    path: 'register',
                    component: () => import('../views/hospital/views/register/register.vue'),

                },
                {
                    path: 'booking',
                    component: () => import('../views/hospital/views/booking/booking.vue'),
                },
                {
                    path: "client",
                    component: () => import('../views/hospital/views/client/client.vue')
                },
                {
                    path: 'detail',
                    component: () => import('../views/hospital/views/detail/detail.vue'),
                },
                {
                    path: 'notice',
                    component: () => import('../views/hospital/views/notice/notice.vue'),
                },
                {
                    path: 'close',
                    component: () => import('../views/hospital/views/close/close.vue'),
                },
                {
                    path: 'search',
                    component: () => import('../views/hospital/views/search/search.vue'),
                },

            ]
        },
        {
            path: '/404',
            component: () => import('../views/404/404.vue')

        },
        {
            path: '/:pathMatch(.*)',
            redirect: '/404'
        }
    ]
})

export default router
